import os
from dotenv import load_dotenv

load_dotenv()  # 加载环境变量


class Config:
    # MySQL配置
    DB_HOST = os.getenv("DB_HOST", "mysql.database-test.oigbuy.com")
    DB_PORT = int(os.getenv("DB_PORT", 3306))
    DB_USER = os.getenv("DB_USER", "root")
    DB_PASS = os.getenv("DB_PASSWORD", "OIG20190918!")
    DB_NAME = os.getenv("DB_NAME", "fastapi")


    # 钉钉机器人配置
    DINGTALK_WEBHOOK = os.getenv("DINGTALK_WEBHOOK", "https://oapi.dingtalk.com/robot/send?access_token=f728a48a5fd3c39b0a86387bedcb54c927e00bb6411b012a640171add84ea015")

    # 电话预警接口（示例）
    VOICE_API_URL = os.getenv("VOICE_API_URL", "https://jumfixed.market.alicloudapi.com")
    VOICE_API_PATH = os.getenv("VOICE_API_PATH", "/voice-notify/send")
    VOICE_APP_CODE = os.getenv("VOICE_APP_CODE", "e963017275ec4594a22af0d0cc2440b8")
    TEMPLATE_ID = os.getenv("TEMPLATE_ID", "JMPQD3QERZZA")

    # 检查间隔（分钟）
    CHECK_INTERVAL = int(os.getenv("CHECK_INTERVAL", 2))

    # 日志级别
    LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")

    # 默认时区
    DEFAULT_TIMEZONE = os.getenv("DEFAULT_TIMEZONE", "Asia/Shanghai")

    # 节假日国家代码
    HOLIDAYS_COUNTRY = os.getenv("HOLIDAYS_COUNTRY", "CN")
